package com.grey_zoo.lottery.eventhandler;

import org.json.JSONObject;

import ZhongXinFenPai.TIntent;

import com.grey_zoo.lottery.event.TecentEvent;
import com.grey_zoo.lottery.presenter.TecentEventManager.LoginListener;

public class TecentEventHandler {

	public static int CreateTecentInstance(int flag) {

		TecentEvent event = new TecentEvent();
		event.flag = flag;
		TIntent.getInstance().dispatch(event, null);
		return 0;

	}

	public static void TryLoginEventHand(int flag, LoginListener listener) {
		TecentEvent event = new TecentEvent();
		event.flag = flag;
		event.listener = listener;
		TIntent.getInstance().dispatch(event, null);

	}

	public static void GetQQInfoEventHand(int flag, LoginListener listener) {
		TecentEvent event = new TecentEvent();
		event.flag = flag;
		event.listener = listener;
		TIntent.getInstance().dispatch(event, null);

	}

	public static boolean QQLoginEventHand(int flag) {
		TecentEvent event = new TecentEvent();
		event.flag = flag;

		TIntent.getInstance().dispatch(event, null);

		return true;
	}

	public static boolean AnalyUserInfoEventHand(int flag, JSONObject response) {
		TecentEvent event = new TecentEvent();
		event.flag = flag;
		event.response = response;

		TIntent.getInstance().dispatch(event, null);

		return false;
	}

	public static void LoginOutEventHand(int flag) {
		TecentEvent event = new TecentEvent();
		event.flag = flag;

		TIntent.getInstance().dispatch(event, null);

	}
}
